﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Testy
{
    class Program
    {
        static void StringReverse(string str)
        {
            string[] splitWords = str.Split(' ');

            foreach (string word in splitWords)
            {
                WordReverse(word);
            }
            Console.WriteLine();    
        }

        static void WordReverse(string str)
        {
            char[] ch = str.ToCharArray();
            char chTemp;
            for (int i = 0, j = ch.Length - 1; i < ch.Length / 2; i++, j--)
            {
                chTemp = ch[i];
                ch[i] = ch[j];
                ch[j] = chTemp;
            }
            Console.Write(ch);
            Console.Write(" ");
        }

        static void Main(string[] args)
        {
            StringReverse("Mother washed framing");
        }
    }
}
